<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="统计口径 xn/hx/zx" prop="projectScope">
        <el-input
          v-model="queryParams.projectScope"
          placeholder="请输入统计口径 xn/hx/zx"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司代码" prop="schoolCode">
        <el-input
          v-model="queryParams.schoolCode"
          placeholder="请输入公司代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司名称" prop="schoolName">
        <el-input
          v-model="queryParams.schoolName"
          placeholder="请输入公司名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司代码" prop="collegeCode">
        <el-input
          v-model="queryParams.collegeCode"
          placeholder="请输入公司代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司名称" prop="collegeName">
        <el-input
          v-model="queryParams.collegeName"
          placeholder="请输入公司名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部系代码" prop="deptCode">
        <el-input
          v-model="queryParams.deptCode"
          placeholder="请输入部系代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部系名称" prop="deptName">
        <el-input
          v-model="queryParams.deptName"
          placeholder="请输入部系名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="科研机构名称" prop="kyjgName">
        <el-input
          v-model="queryParams.kyjgName"
          placeholder="请输入科研机构名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目编号" prop="projectNum">
        <el-input
          v-model="queryParams.projectNum"
          placeholder="请输入项目编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目类别" prop="projectCate">
        <el-input
          v-model="queryParams.projectCate"
          placeholder="请输入项目类别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目负责人" prop="projectUser">
        <el-input
          v-model="queryParams.projectUser"
          placeholder="请输入项目负责人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目专家" prop="xmzj">
        <el-input
          v-model="queryParams.xmzj"
          placeholder="请输入项目专家"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学科" prop="xk">
        <el-input
          v-model="queryParams.xk"
          placeholder="请输入学科"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目预算" prop="xmys">
        <el-input
          v-model="queryParams.xmys"
          placeholder="请输入项目预算"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="申报类型" prop="sblx">
        <el-input
          v-model="queryParams.sblx"
          placeholder="请输入申报类型"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开始时间" prop="startTime">
        <el-date-picker clearable
          v-model="queryParams.startTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束时间" prop="endTime">
        <el-date-picker clearable
          v-model="queryParams.endTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择结束时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="项目说明" prop="instructions">
        <el-input
          v-model="queryParams.instructions"
          placeholder="请输入项目说明"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="申请人" prop="applyUser">
        <el-input
          v-model="queryParams.applyUser"
          placeholder="请输入申请人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="申请部门" prop="applyDept">
        <el-input
          v-model="queryParams.applyDept"
          placeholder="请输入申请部门"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="申请时间" prop="applyTime">
        <el-date-picker clearable
          v-model="queryParams.applyTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择申请时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="审核" prop="audit">
        <el-input
          v-model="queryParams.audit"
          placeholder="请输入审核"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="意见" prop="opinion">
        <el-input
          v-model="queryParams.opinion"
          placeholder="请输入意见"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审核时间" prop="auditTime">
        <el-date-picker clearable
          v-model="queryParams.auditTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择审核时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="驳回时间" prop="rejectTime">
        <el-date-picker clearable
          v-model="queryParams.rejectTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择驳回时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="立项编号" prop="lxNum">
        <el-input
          v-model="queryParams.lxNum"
          placeholder="请输入立项编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="立项时间" prop="lxTime">
        <el-date-picker clearable
          v-model="queryParams.lxTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择立项时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="批文号" prop="pwh">
        <el-input
          v-model="queryParams.pwh"
          placeholder="请输入批文号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="活动编码" prop="hdbm">
        <el-input
          v-model="queryParams.hdbm"
          placeholder="请输入活动编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="活动名称" prop="hdmc">
        <el-input
          v-model="queryParams.hdmc"
          placeholder="请输入活动名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="活动情况" prop="hdqk">
        <el-input
          v-model="queryParams.hdqk"
          placeholder="请输入活动情况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="活动报告附件" prop="hdbgfj">
        <el-input
          v-model="queryParams.hdbgfj"
          placeholder="请输入活动报告附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="活动时间" prop="hdsj">
        <el-date-picker clearable
          v-model="queryParams.hdsj"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择活动时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="中检情况" prop="inspection">
        <el-input
          v-model="queryParams.inspection"
          placeholder="请输入中检情况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="中检报告附件" prop="zjbgfj">
        <el-input
          v-model="queryParams.zjbgfj"
          placeholder="请输入中检报告附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="中检经费" prop="inspectionMoney">
        <el-input
          v-model="queryParams.inspectionMoney"
          placeholder="请输入中检经费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="中检时间" prop="inspectionTime">
        <el-date-picker clearable
          v-model="queryParams.inspectionTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择中检时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="项目状态" prop="projectState">
        <el-input
          v-model="queryParams.projectState"
          placeholder="请输入项目状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="终结情况" prop="zjqk">
        <el-input
          v-model="queryParams.zjqk"
          placeholder="请输入终结情况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="完成时间" prop="finishTime">
        <el-date-picker clearable
          v-model="queryParams.finishTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择完成时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="成果名称" prop="cgmc">
        <el-input
          v-model="queryParams.cgmc"
          placeholder="请输入成果名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果转化作者" prop="cgzhzz">
        <el-input
          v-model="queryParams.cgzhzz"
          placeholder="请输入成果转化作者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果分类" prop="cgfl">
        <el-input
          v-model="queryParams.cgfl"
          placeholder="请输入成果分类"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果级别" prop="cgjb">
        <el-input
          v-model="queryParams.cgjb"
          placeholder="请输入成果级别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果报告及附件" prop="cgbgjfj">
        <el-input
          v-model="queryParams.cgbgjfj"
          placeholder="请输入成果报告及附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果说明" prop="cgsm">
        <el-input
          v-model="queryParams.cgsm"
          placeholder="请输入成果说明"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果奖项" prop="cgjx">
        <el-input
          v-model="queryParams.cgjx"
          placeholder="请输入成果奖项"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果奖励" prop="cgjl">
        <el-input
          v-model="queryParams.cgjl"
          placeholder="请输入成果奖励"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成果附件" prop="cgfj">
        <el-input
          v-model="queryParams.cgfj"
          placeholder="请输入成果附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="转化说明" prop="zhsm">
        <el-input
          v-model="queryParams.zhsm"
          placeholder="请输入转化说明"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="转化报告及附件" prop="zhAttachment">
        <el-input
          v-model="queryParams.zhAttachment"
          placeholder="请输入转化报告及附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="转化时间" prop="zhsj">
        <el-date-picker clearable
          v-model="queryParams.zhsj"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择转化时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="项目决算" prop="xmjs">
        <el-input
          v-model="queryParams.xmjs"
          placeholder="请输入项目决算"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="决算报告及附件" prop="jsAttachment">
        <el-input
          v-model="queryParams.jsAttachment"
          placeholder="请输入决算报告及附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目成本" prop="xmcb">
        <el-input
          v-model="queryParams.xmcb"
          placeholder="请输入项目成本"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="科研机构代码" prop="kyCode">
        <el-input
          v-model="queryParams.kyCode"
          placeholder="请输入科研机构代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="决算时间" prop="jsTime">
        <el-date-picker clearable
          v-model="queryParams.jsTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择决算时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="项目评价" prop="xmpj">
        <el-input
          v-model="queryParams.xmpj"
          placeholder="请输入项目评价"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="评价报告及附件" prop="pjAttachment">
        <el-input
          v-model="queryParams.pjAttachment"
          placeholder="请输入评价报告及附件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目评分" prop="xmpf">
        <el-input
          v-model="queryParams.xmpf"
          placeholder="请输入项目评分"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="统计年度" prop="staYear">
        <el-input
          v-model="queryParams.staYear"
          placeholder="请输入统计年度"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="评价时间" prop="evaluateTime">
        <el-date-picker clearable
          v-model="queryParams.evaluateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择评价时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['pm:projectManage:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['pm:projectManage:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['pm:projectManage:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['pm:projectManage:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="projectManageList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键" align="center" prop="id" />
      <el-table-column label="统计口径 xn/hx/zx" align="center" prop="projectScope" />
      <el-table-column label="公司代码" align="center" prop="schoolCode" />
      <el-table-column label="公司名称" align="center" prop="schoolName" />
      <el-table-column label="公司代码" align="center" prop="collegeCode" />
      <el-table-column label="公司名称" align="center" prop="collegeName" />
      <el-table-column label="部系代码" align="center" prop="deptCode" />
      <el-table-column label="部系名称" align="center" prop="deptName" />
      <el-table-column label="项目类型" align="center" prop="projectType" />
      <el-table-column label="科研机构名称" align="center" prop="kyjgName" />
      <el-table-column label="项目编号" align="center" prop="projectNum" />
      <el-table-column label="项目名称" align="center" prop="projectName" />
      <el-table-column label="项目类别" align="center" prop="projectCate" />
      <el-table-column label="项目负责人" align="center" prop="projectUser" />
      <el-table-column label="项目专家" align="center" prop="xmzj" />
      <el-table-column label="学科" align="center" prop="xk" />
      <el-table-column label="项目预算" align="center" prop="xmys" />
      <el-table-column label="申报类型" align="center" prop="sblx" />
      <el-table-column label="开始时间" align="center" prop="startTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束时间" align="center" prop="endTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="项目说明" align="center" prop="instructions" />
      <el-table-column label="申请人" align="center" prop="applyUser" />
      <el-table-column label="申请部门" align="center" prop="applyDept" />
      <el-table-column label="申请时间" align="center" prop="applyTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核" align="center" prop="audit" />
      <el-table-column label="意见" align="center" prop="opinion" />
      <el-table-column label="审核时间" align="center" prop="auditTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="驳回时间" align="center" prop="rejectTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.rejectTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="立项编号" align="center" prop="lxNum" />
      <el-table-column label="立项时间" align="center" prop="lxTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lxTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="批文号" align="center" prop="pwh" />
      <el-table-column label="活动编码" align="center" prop="hdbm" />
      <el-table-column label="活动名称" align="center" prop="hdmc" />
      <el-table-column label="活动情况" align="center" prop="hdqk" />
      <el-table-column label="活动报告附件" align="center" prop="hdbgfj" />
      <el-table-column label="活动时间" align="center" prop="hdsj" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.hdsj, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="中检情况" align="center" prop="inspection" />
      <el-table-column label="中检报告附件" align="center" prop="zjbgfj" />
      <el-table-column label="中检经费" align="center" prop="inspectionMoney" />
      <el-table-column label="中检时间" align="center" prop="inspectionTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.inspectionTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="项目状态" align="center" prop="projectState" />
      <el-table-column label="终结情况" align="center" prop="zjqk" />
      <el-table-column label="完成时间" align="center" prop="finishTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="成果名称" align="center" prop="cgmc" />
      <el-table-column label="成果转化作者" align="center" prop="cgzhzz" />
      <el-table-column label="成果分类" align="center" prop="cgfl" />
      <el-table-column label="成果级别" align="center" prop="cgjb" />
      <el-table-column label="成果报告及附件" align="center" prop="cgbgjfj" />
      <el-table-column label="成果说明" align="center" prop="cgsm" />
      <el-table-column label="成果奖项" align="center" prop="cgjx" />
      <el-table-column label="成果奖励" align="center" prop="cgjl" />
      <el-table-column label="成果附件" align="center" prop="cgfj" />
      <el-table-column label="转化说明" align="center" prop="zhsm" />
      <el-table-column label="转化报告及附件" align="center" prop="zhAttachment" />
      <el-table-column label="转化时间" align="center" prop="zhsj" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.zhsj, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="项目决算" align="center" prop="xmjs" />
      <el-table-column label="决算报告及附件" align="center" prop="jsAttachment" />
      <el-table-column label="项目成本" align="center" prop="xmcb" />
      <el-table-column label="科研机构类型" align="center" prop="kyType" />
      <el-table-column label="科研机构代码" align="center" prop="kyCode" />
      <el-table-column label="决算时间" align="center" prop="jsTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.jsTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="项目评价" align="center" prop="xmpj" />
      <el-table-column label="评价报告及附件" align="center" prop="pjAttachment" />
      <el-table-column label="项目评分" align="center" prop="xmpf" />
      <el-table-column label="统计年度" align="center" prop="staYear" />
      <el-table-column label="评价时间" align="center" prop="evaluateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.evaluateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['pm:projectManage:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['pm:projectManage:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改校级项目对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="统计口径 xn/hx/zx" prop="projectScope">
          <el-input v-model="form.projectScope" placeholder="请输入统计口径 xn/hx/zx" />
        </el-form-item>
<!--        <el-form-item label="学校代码" prop="schoolCode">-->
<!--          <el-input v-model="form.schoolCode" placeholder="请输入学校代码" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="学校名称" prop="schoolName">-->
<!--          <el-input v-model="form.schoolName" placeholder="请输入学校名称" />-->
<!--        </el-form-item>-->
        <el-form-item label="公司代码" prop="collegeCode">
          <el-input v-model="form.collegeCode" placeholder="请输入公司代码" />
        </el-form-item>
        <el-form-item label="公司名称" prop="collegeName">
          <el-input v-model="form.collegeName" placeholder="请输入公司名称" />
        </el-form-item>
        <el-form-item label="部系代码" prop="deptCode">
          <el-input v-model="form.deptCode" placeholder="请输入部系代码" />
        </el-form-item>
        <el-form-item label="部系名称" prop="deptName">
          <el-input v-model="form.deptName" placeholder="请输入部系名称" />
        </el-form-item>
        <el-form-item label="科研机构名称" prop="kyjgName">
          <el-input v-model="form.kyjgName" placeholder="请输入科研机构名称" />
        </el-form-item>
        <el-form-item label="项目编号" prop="projectNum">
          <el-input v-model="form.projectNum" placeholder="请输入项目编号" />
        </el-form-item>
        <el-form-item label="项目名称" prop="projectName">
          <el-input v-model="form.projectName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="项目类别" prop="projectCate">
          <el-input v-model="form.projectCate" placeholder="请输入项目类别" />
        </el-form-item>
        <el-form-item label="项目负责人" prop="projectUser">
          <el-input v-model="form.projectUser" placeholder="请输入项目负责人" />
        </el-form-item>
        <el-form-item label="项目专家" prop="xmzj">
          <el-input v-model="form.xmzj" placeholder="请输入项目专家" />
        </el-form-item>
        <el-form-item label="学科" prop="xk">
          <el-input v-model="form.xk" placeholder="请输入学科" />
        </el-form-item>
        <el-form-item label="项目预算" prop="xmys">
          <el-input v-model="form.xmys" placeholder="请输入项目预算" />
        </el-form-item>
        <el-form-item label="申报类型" prop="sblx">
          <el-input v-model="form.sblx" placeholder="请输入申报类型" />
        </el-form-item>
        <el-form-item label="开始时间" prop="startTime">
          <el-date-picker clearable
            v-model="form.startTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="endTime">
          <el-date-picker clearable
            v-model="form.endTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="项目说明" prop="instructions">
          <el-input v-model="form.instructions" placeholder="请输入项目说明" />
        </el-form-item>
        <el-form-item label="申请人" prop="applyUser">
          <el-input v-model="form.applyUser" placeholder="请输入申请人" />
        </el-form-item>
        <el-form-item label="申请部门" prop="applyDept">
          <el-input v-model="form.applyDept" placeholder="请输入申请部门" />
        </el-form-item>
        <el-form-item label="申请时间" prop="applyTime">
          <el-date-picker clearable
            v-model="form.applyTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择申请时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="审核" prop="audit">
          <el-input v-model="form.audit" placeholder="请输入审核" />
        </el-form-item>
        <el-form-item label="意见" prop="opinion">
          <el-input v-model="form.opinion" placeholder="请输入意见" />
        </el-form-item>
        <el-form-item label="审核时间" prop="auditTime">
          <el-date-picker clearable
            v-model="form.auditTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择审核时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="驳回时间" prop="rejectTime">
          <el-date-picker clearable
            v-model="form.rejectTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择驳回时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="立项编号" prop="lxNum">
          <el-input v-model="form.lxNum" placeholder="请输入立项编号" />
        </el-form-item>
        <el-form-item label="立项时间" prop="lxTime">
          <el-date-picker clearable
            v-model="form.lxTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择立项时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="批文号" prop="pwh">
          <el-input v-model="form.pwh" placeholder="请输入批文号" />
        </el-form-item>
        <el-form-item label="活动编码" prop="hdbm">
          <el-input v-model="form.hdbm" placeholder="请输入活动编码" />
        </el-form-item>
        <el-form-item label="活动名称" prop="hdmc">
          <el-input v-model="form.hdmc" placeholder="请输入活动名称" />
        </el-form-item>
        <el-form-item label="活动情况" prop="hdqk">
          <el-input v-model="form.hdqk" placeholder="请输入活动情况" />
        </el-form-item>
        <el-form-item label="活动报告附件" prop="hdbgfj">
          <el-input v-model="form.hdbgfj" placeholder="请输入活动报告附件" />
        </el-form-item>
        <el-form-item label="活动时间" prop="hdsj">
          <el-date-picker clearable
            v-model="form.hdsj"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择活动时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="中检情况" prop="inspection">
          <el-input v-model="form.inspection" placeholder="请输入中检情况" />
        </el-form-item>
        <el-form-item label="中检报告附件" prop="zjbgfj">
          <el-input v-model="form.zjbgfj" placeholder="请输入中检报告附件" />
        </el-form-item>
        <el-form-item label="中检经费" prop="inspectionMoney">
          <el-input v-model="form.inspectionMoney" placeholder="请输入中检经费" />
        </el-form-item>
        <el-form-item label="中检时间" prop="inspectionTime">
          <el-date-picker clearable
            v-model="form.inspectionTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择中检时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="项目状态" prop="projectState">
          <el-input v-model="form.projectState" placeholder="请输入项目状态" />
        </el-form-item>
        <el-form-item label="终结情况" prop="zjqk">
          <el-input v-model="form.zjqk" placeholder="请输入终结情况" />
        </el-form-item>
        <el-form-item label="完成时间" prop="finishTime">
          <el-date-picker clearable
            v-model="form.finishTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择完成时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="成果名称" prop="cgmc">
          <el-input v-model="form.cgmc" placeholder="请输入成果名称" />
        </el-form-item>
        <el-form-item label="成果转化作者" prop="cgzhzz">
          <el-input v-model="form.cgzhzz" placeholder="请输入成果转化作者" />
        </el-form-item>
        <el-form-item label="成果分类" prop="cgfl">
          <el-input v-model="form.cgfl" placeholder="请输入成果分类" />
        </el-form-item>
        <el-form-item label="成果级别" prop="cgjb">
          <el-input v-model="form.cgjb" placeholder="请输入成果级别" />
        </el-form-item>
        <el-form-item label="成果报告及附件" prop="cgbgjfj">
          <el-input v-model="form.cgbgjfj" placeholder="请输入成果报告及附件" />
        </el-form-item>
        <el-form-item label="成果说明" prop="cgsm">
          <el-input v-model="form.cgsm" placeholder="请输入成果说明" />
        </el-form-item>
        <el-form-item label="成果奖项" prop="cgjx">
          <el-input v-model="form.cgjx" placeholder="请输入成果奖项" />
        </el-form-item>
        <el-form-item label="成果奖励" prop="cgjl">
          <el-input v-model="form.cgjl" placeholder="请输入成果奖励" />
        </el-form-item>
        <el-form-item label="成果附件" prop="cgfj">
          <el-input v-model="form.cgfj" placeholder="请输入成果附件" />
        </el-form-item>
        <el-form-item label="转化说明" prop="zhsm">
          <el-input v-model="form.zhsm" placeholder="请输入转化说明" />
        </el-form-item>
        <el-form-item label="转化报告及附件" prop="zhAttachment">
          <el-input v-model="form.zhAttachment" placeholder="请输入转化报告及附件" />
        </el-form-item>
        <el-form-item label="转化时间" prop="zhsj">
          <el-date-picker clearable
            v-model="form.zhsj"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择转化时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="项目决算" prop="xmjs">
          <el-input v-model="form.xmjs" placeholder="请输入项目决算" />
        </el-form-item>
        <el-form-item label="决算报告及附件" prop="jsAttachment">
          <el-input v-model="form.jsAttachment" placeholder="请输入决算报告及附件" />
        </el-form-item>
        <el-form-item label="项目成本" prop="xmcb">
          <el-input v-model="form.xmcb" placeholder="请输入项目成本" />
        </el-form-item>
        <el-form-item label="科研机构代码" prop="kyCode">
          <el-input v-model="form.kyCode" placeholder="请输入科研机构代码" />
        </el-form-item>
        <el-form-item label="决算时间" prop="jsTime">
          <el-date-picker clearable
            v-model="form.jsTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择决算时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="项目评价" prop="xmpj">
          <el-input v-model="form.xmpj" placeholder="请输入项目评价" />
        </el-form-item>
        <el-form-item label="评价报告及附件" prop="pjAttachment">
          <el-input v-model="form.pjAttachment" placeholder="请输入评价报告及附件" />
        </el-form-item>
        <el-form-item label="项目评分" prop="xmpf">
          <el-input v-model="form.xmpf" placeholder="请输入项目评分" />
        </el-form-item>
        <el-form-item label="统计年度" prop="staYear">
          <el-input v-model="form.staYear" placeholder="请输入统计年度" />
        </el-form-item>
        <el-form-item label="评价时间" prop="evaluateTime">
          <el-date-picker clearable
            v-model="form.evaluateTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择评价时间">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listProjectManage, getProjectManage, delProjectManage, addProjectManage, updateProjectManage } from "@/api/pm/projectManage";

export default {
  name: "ProjectManage",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 校级项目表格数据
      projectManageList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        projectScope: null,
        schoolCode: null,
        schoolName: null,
        collegeCode: null,
        collegeName: null,
        deptCode: null,
        deptName: null,
        projectType: null,
        kyjgName: null,
        projectNum: null,
        projectName: null,
        projectCate: null,
        projectUser: null,
        xmzj: null,
        xk: null,
        xmys: null,
        sblx: null,
        startTime: null,
        endTime: null,
        instructions: null,
        applyUser: null,
        applyDept: null,
        applyTime: null,
        audit: null,
        opinion: null,
        auditTime: null,
        rejectTime: null,
        lxNum: null,
        lxTime: null,
        pwh: null,
        hdbm: null,
        hdmc: null,
        hdqk: null,
        hdbgfj: null,
        hdsj: null,
        inspection: null,
        zjbgfj: null,
        inspectionMoney: null,
        inspectionTime: null,
        projectState: null,
        zjqk: null,
        finishTime: null,
        cgmc: null,
        cgzhzz: null,
        cgfl: null,
        cgjb: null,
        cgbgjfj: null,
        cgsm: null,
        cgjx: null,
        cgjl: null,
        cgfj: null,
        zhsm: null,
        zhAttachment: null,
        zhsj: null,
        xmjs: null,
        jsAttachment: null,
        xmcb: null,
        kyType: null,
        kyCode: null,
        jsTime: null,
        xmpj: null,
        pjAttachment: null,
        xmpf: null,
        staYear: null,
        evaluateTime: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询校级项目列表 */
    getList() {
      this.loading = true;
      listProjectManage(this.queryParams).then(response => {
        this.projectManageList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        projectScope: null,
        schoolCode: null,
        schoolName: null,
        collegeCode: null,
        collegeName: null,
        deptCode: null,
        deptName: null,
        projectType: null,
        kyjgName: null,
        projectNum: null,
        projectName: null,
        projectCate: null,
        projectUser: null,
        xmzj: null,
        xk: null,
        xmys: null,
        sblx: null,
        startTime: null,
        endTime: null,
        instructions: null,
        applyUser: null,
        applyDept: null,
        applyTime: null,
        audit: null,
        opinion: null,
        auditTime: null,
        rejectTime: null,
        lxNum: null,
        lxTime: null,
        pwh: null,
        hdbm: null,
        hdmc: null,
        hdqk: null,
        hdbgfj: null,
        hdsj: null,
        inspection: null,
        zjbgfj: null,
        inspectionMoney: null,
        inspectionTime: null,
        projectState: null,
        zjqk: null,
        finishTime: null,
        cgmc: null,
        cgzhzz: null,
        cgfl: null,
        cgjb: null,
        cgbgjfj: null,
        cgsm: null,
        cgjx: null,
        cgjl: null,
        cgfj: null,
        zhsm: null,
        zhAttachment: null,
        zhsj: null,
        xmjs: null,
        jsAttachment: null,
        xmcb: null,
        kyType: null,
        kyCode: null,
        jsTime: null,
        xmpj: null,
        pjAttachment: null,
        xmpf: null,
        staYear: null,
        evaluateTime: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加校级项目";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getProjectManage(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改校级项目";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateProjectManage(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addProjectManage(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除校级项目编号为"' + ids + '"的数据项？').then(function() {
        return delProjectManage(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('pm/projectManage/export', {
        ...this.queryParams
      }, `projectManage_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
